﻿package Space.Interface 
{
	import flash.display.Sprite;
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.geom.*;
	import org.aswing.colorchooser.*;
	import org.aswing.ext.*;
	
	public class ObjectInformation extends Sprite
	{
		private var tempInf:Array;
		
		public function ObjectInformation(data:String,x:Number,y:Number) 
		{
			tempInf = data.split(":");
			
			if (tempInf[1] == "Star")
			{
				var tempLabel:JLabel;
				var tempPanel:JPanel = new JPanel();
				tempPanel.setSize(new IntDimension(100, 75));
				if (x > 950) x = x - 100;
				if (y > 600) y = y - 80;
				tempPanel.setLocationXY(x+10, y);
				tempPanel.setBackground(new ASColor(0x3300, .5));
				tempPanel.setOpaque(true);
				var border0:LineBorder = new LineBorder();
				border0.setColor(new ASColor(0x6600, 1));
				tempPanel.setBorder(border0);
				var layout1:FlowLayout = new FlowLayout();
				layout1.setAlignment(AsWingConstants.CENTER);
				tempPanel.setLayout(layout1);

				/*tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 14, true, false, false, false));
				tempLabel.setForeground(new ASColor(0x9900, 1));
				tempLabel.setLocation(new IntPoint(5, 5));
				tempLabel.setSize(new IntDimension(90, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.CENTER);
				tempLabel.setText(tempInf[1]);
				tempPanel.append(tempLabel);*/

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0x9900, 1));
				tempLabel.setLocation(new IntPoint(5, 5));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.RIGHT);
				tempLabel.setText("X:");
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0xffffff, 1));
				tempLabel.setLocation(new IntPoint(55, 5));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.LEFT);
				tempLabel.setText(tempInf[2]);
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0x9900, 1));
				tempLabel.setLocation(new IntPoint(5, 20));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.RIGHT);
				tempLabel.setText("Y:");
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0xffffff, 1));
				tempLabel.setLocation(new IntPoint(55, 20));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.LEFT);
				tempLabel.setText(tempInf[3]);
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0x9900, 1));
				tempLabel.setLocation(new IntPoint(5, 35));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.RIGHT);
				tempLabel.setText("Z:");
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0xffffff, 1));
				tempLabel.setLocation(new IntPoint(55, 35));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.LEFT);
				tempLabel.setText(tempInf[4]);
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0x9900, 1));
				tempLabel.setLocation(new IntPoint(5, 50));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.RIGHT);
				tempLabel.setText("Planets:");
				tempPanel.append(tempLabel);

				tempLabel = new JLabel();
				tempLabel.setFont(new ASFont("Arial", 12, false, false, false, false));
				tempLabel.setForeground(new ASColor(0xffffff, 1));
				tempLabel.setLocation(new IntPoint(55, 50));
				tempLabel.setSize(new IntDimension(50, 19));
				tempLabel.setHorizontalAlignment(AsWingConstants.LEFT);
				tempLabel.setText(tempInf[5]);
				tempPanel.append(tempLabel);

				addChild(tempPanel);
			}
		}
		
	}
	
}